package com.chinasoft.ui;

import javax.swing.*;
import java.awt.*;

public class TestWindow {

    public static void main(String[] args) {
        JFrame frame = new JFrame("this is window");

        frame.setLocation(100, 100);
        frame.setSize(815, 655);
        // title 和 icon
        frame.setTitle("骑士夺宝");
        frame.setIconImage(Toolkit.getDefaultToolkit().getImage(TestWindow.class.getResource("/image/person01.png")));

        // 面板对象
        Container pane = frame.getContentPane();
        pane.setLayout(null);

        // 添加背景
        JLabel bg = new JLabel("bg");
        bg.setIcon(new ImageIcon(TestWindow.class.getResource("/image/guanka.png")));
        bg.setBounds(5, 5, 790, 600);
        pane.add(bg);

        // 添加 图片
        JLabel lblMainIcon = new JLabel("New label");
//        lblMainIcon.setIcon(new ImageIcon(.class.getResource("/image/2.png")));
        lblMainIcon.setBounds(256, 61, 299, 132);
        pane.add(lblMainIcon);

        frame.setVisible(true);
    }
}
